package com.dhy.takeaway.controller;

import com.dhy.takeaway.entity.Buyer;
import com.dhy.takeaway.entity.Res;
import com.dhy.takeaway.service.FrontLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FrontLoginController {

    @Autowired
    FrontLoginService frontLoginService;

    @PostMapping("/findBuyer")
    public Res findBuyer(@RequestBody Buyer buyer){
        return frontLoginService.findBuyer(buyer);
    }

    @PostMapping("/registerBuyer")
    public Res register(@RequestBody Buyer buyer){
        return frontLoginService.register(buyer);
    }
}
